<!DOCTYPE html>
<html>

<head>
    <!-- 网页中的各种高度测试 -->
    <meta charset="utf-8">
    <title>高度测试</title>


    <style>
        #d1{
            width: 400px;
            height: 400px;
            background-color: burlywood;
            overflow: auto;
        }

        #d2{
            width: 600px;
            height: 600px;
            background-color: black;
            color: white;
            padding: 20px;
            border: 2px solid green;
            margin: 50px;
        }
    </style>

</head>

<body>
    <div id="d1">
        <div id="d2">66661</div>
    </div>

</body>

</html>

<script>
    var tt = {
        scrollHeight: d2.scrollHeight,
        clientHeight: d2.clientHeight,
        offsetHeight: d2.offsetHeight,
    }
</script>